package org.framework.define.bean.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the tbl_user database table.
 * 
 */
@Entity
@Table(name="tbl_user")
public class TblUser implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="user_id", unique=true, nullable=false, length=20)
	private String userId;

	@Column(name="last_login_ip", length=20)
	private String lastLoginIp;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="last_login_time")
	private Date lastLoginTime;

	@Column(name="black_count", nullable=false)
	private int blackCount;

	@Column(name="login_err_count", nullable=false)
	private int loginErrCount;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="login_err_time")
	private Date loginErrTime;

	@Column(name="login_name", nullable=false, length=20)
	private String loginName;

	@Column(name="login_pwd", nullable=false, length=32)
	private String loginPwd;

	@Column(name="oper_err_count", nullable=false)
	private int operErrCount;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="oper_err_time")
	private Date operErrTime;

	@Column(name="oper_pwd", nullable=false, length=32)
	private String operPwd;

	@Column(name="parent_id", length=20)
	private String parentId;

	@Column(name="user_state", nullable=false, length=5)
	private String userState;

	@Column(name="user_type", nullable=false)
	private int userType;

	//uni-directional one-to-one association to TblUserAccount
	@OneToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="user_id", nullable=false, insertable=false, updatable=false)
	private TblUserAccount tblUserAccount;
	
	//uni-directional one-to-one association to TblUserInfo
	@OneToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="user_id", nullable=false, insertable=false, updatable=false)
	private TblUserInfo tblUserInfo;

	//uni-directional one-to-one association to TblUserInfo
	@OneToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="user_id", nullable=false, insertable=false, updatable=false)
	private TblUserProgress tblUserProgress;
		
	public TblUser() {
	}

	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getLastLoginIp() {
		return this.lastLoginIp;
	}

	public void setLastLoginIp(String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}

	public Date getLastLoginTime() {
		return this.lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public int getBlackCount() {
		return blackCount;
	}

	public void setBlackCount(int blackCount) {
		this.blackCount = blackCount;
	}

	public int getLoginErrCount() {
		return this.loginErrCount;
	}

	public void setLoginErrCount(int loginErrCount) {
		this.loginErrCount = loginErrCount;
	}

	public Date getLoginErrTime() {
		return this.loginErrTime;
	}

	public void setLoginErrTime(Date loginErrTime) {
		this.loginErrTime = loginErrTime;
	}

	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getLoginPwd() {
		return this.loginPwd;
	}

	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}

	public int getOperErrCount() {
		return this.operErrCount;
	}

	public void setOperErrCount(int operErrCount) {
		this.operErrCount = operErrCount;
	}

	public Date getOperErrTime() {
		return this.operErrTime;
	}

	public void setOperErrTime(Date operErrTime) {
		this.operErrTime = operErrTime;
	}

	public String getOperPwd() {
		return this.operPwd;
	}

	public void setOperPwd(String operPwd) {
		this.operPwd = operPwd;
	}

	public String getParentId() {
		return this.parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getUserState() {
		return this.userState;
	}

	public void setUserState(String userState) {
		this.userState = userState;
	}

	public int getUserType() {
		return this.userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

	public TblUserAccount getTblUserAccount() {
		return this.tblUserAccount;
	}

	public void setTblUserAccount(TblUserAccount tblUserAccount) {
		this.tblUserAccount = tblUserAccount;
	}

	public TblUserInfo getTblUserInfo() {
		return this.tblUserInfo;
	}

	public void setTblUserInfo(TblUserInfo tblUserInfo) {
		this.tblUserInfo = tblUserInfo;
	}

	public TblUserProgress getTblUserProgress() {
		return tblUserProgress;
	}

	public void setTblUserProgress(TblUserProgress tblUserProgress) {
		this.tblUserProgress = tblUserProgress;
	}
	
}